export function translateTree(list, root) {
  const arr = []
  list.forEach((item) => {
    if (item.pid === root) {
      const children = translateTree(list, item.id)
      item.children = children
      arr.push(item)
    }
  })
  return arr
}
